<html>
<meta charset="UTF-8">
<style>
    table {
        border-collapse: collapse;
        border-spacing: 0;
        width: 100%;
        border-bottom: 1px solid #666;
        border-right: 1px solid #666;
        text-align: center;
    }

    td, th {
        border-top: 1px solid #666;
        border-left: 1px solid #666;
        padding: 8px 2px;
        text-align: center;
    }

    .none-border,.none-border td,.none-border th{
        border: none;
    }
</style>
<body>
<h3 align="center" style="margin:0 auto;text-align:center;line-height: 1.5">宁波衣加衣供应链管理有限公司</h3>
<h4 align="center" style="margin:0 auto;text-align:center;line-height: 1.5">${data.title}
</h4>
<h4 align="left" style="margin:0 auto;text-align:center;line-height: 1.5">${data.creationTime,dateFormat="yyyy-MM-dd"}
</h4>
<table>
    <thead>
    <tr>
        <th align="right" style="text-align: right" colspan="4" width="12%">成衣厂：</th>
        <th align="left" style="text-align: left" colspan="5" width="12%">广州市利美服装加工厂</th>
        <th colspan="5" width="10%"></th>
        <th colspan="4" width="8%"></th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>产品名称</td>
        <td>波段</td>
        <td>产品款号</td>
        <td>订单款号</td>
        <td>交货时间</td>
        <td>合同时间</td>
        <td>定作方式</td>
        <td>下单数</td>
        <td>裁数</td>
        <td>裁数装箱单数</td>
        <td>正品入库数</td>
        <td>合同单价(不含税)</td>
        <td>贷款金额</td>
        <td>快递费</td>
        <td>扣款</td>
        <td>退货</td>
        <td>结算金额</td>
        <td>备注</td>
    </tr>
    <%
    var orderQuantityTotal = 0;
    var packageQuantityTotal = 0;
    var storageQuantityTotal = 0;
    var loanAmountTotal = 0.0h;
    var expressFeeTotal = 0.0h;
    var settlementAmountTotal = 0.0h;

    for(entry in data.bizData.entries){
    if(entry.orderQuantity != null){
    orderQuantityTotal = orderQuantityTotal + entry.orderQuantity;
    }
    if(entry.packageQuantity != null){
    packageQuantityTotal = packageQuantityTotal + entry.packageQuantity;
    }
    if(entry.storageQuantity != null){
    storageQuantityTotal = storageQuantityTotal + entry.storageQuantity;
    }
    if(entry.loanAmount != null){
    loanAmountTotal = loanAmountTotal + entry.loanAmount;
    }
    if(entry.expressFee != null){
    expressFeeTotal = expressFeeTotal + entry.expressFee;
    }
    if(entry.settlementAmount != null){
    settlementAmountTotal = settlementAmountTotal + entry.settlementAmount;
    }

    %>
    <tr>
        <td>${entry.product.name}</td>
        <td>${entry.waveBand}</td>
        <td>${entry.product.skuID}</td>
        <td>${entry.orderItemNo}</td>
        <td>${entry.deliveryDate,dateFormat="yyyy-MM-dd"}</td>
        <td>${entry.contractDate,dateFormat="yyyy-MM-dd"}</td>
        <td>${entry.customizedMode}</td>
        <td>${entry.orderQuantity}</td>
        <td>${entry.cutQuantity}</td>
        <td>${entry.packageQuantity}</td>
        <td>${entry.storageQuantity}</td>
        <td>${entry.unitContractPrice}</td>
        <td>${entry.loanAmount}</td>
        <td>${entry.expressFee}</td>
        <td>${entry.deductionAmount}</td>
        <td>${entry.returnQuantity}</td>
        <td>${entry.settlementAmount}</td>
        <td>${entry.remarks}</td>
    </tr>
    <% } %>
    <tr>
        <td >合计</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>${orderQuantityTotal}</td>
        <td></td>
        <td>${packageQuantityTotal}</td>
        <td>${storageQuantityTotal}</td>
        <td></td>
        <td>${loanAmountTotal}</td>
        <td>${expressFeeTotal}</td>
        <td></td>
        <td></td>
        <td>${settlementAmountTotal}</td>
        <td></td>
    </tr>
    </tbody>
</table>

<table style="border:none !important;border-color:#fff;margin-top: 60px;" class="none-border">
    <tr>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            甲方：${data.partyAName}
        </td>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            乙方：${data.partyBName}
        </td>
    </tr>
    <tr>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            甲方盖章：
        </td>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            乙方盖章：
        </td>
    </tr>
    <tr>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            日期：
        </td>
        <td align="left" style="text-align: left !important;border:none !important;border-color:#fff;">
            日期：
        </td>
    </tr>
</table>
</body>
</html>